{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<pyspark.context.SparkContext object at 0x7f403e758a90>\n"
     ]
    }
   ],
   "source": [
    "import pyspark\n",
    "from pyspark import SparkConf, SparkContext\n",
    "\n",
    "conf = (SparkConf()\n",
    "         .setMaster(\"local\")\n",
    "         .setAppName(\"MyApp\")\n",
    "         .set(\"spark.executor.memory\", \"1g\"))\n",
    "sc = SparkContext(conf = conf)\n",
    "print(sc)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "MapPartitionsRDD[1] at textFile at NativeMethodAccessorImpl.java:-2\n"
     ]
    }
   ],
   "source": [
    "raw_data = sc.textFile(\"daily_show_guests.csv\")\n",
    "print(raw_data)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['YEAR,GoogleKnowlege_Occupation,Show,Group,Raw_Guest_List',\n",
       " '1999,actor,1/11/99,Acting,Michael J. Fox',\n",
       " '1999,Comedian,1/12/99,Comedy,Sandra Bernhard',\n",
       " '1999,television actress,1/13/99,Acting,Tracey Ullman',\n",
       " '1999,film actress,1/14/99,Acting,Gillian Anderson',\n",
       " '1999,actor,1/18/99,Acting,David Alan Grier',\n",
       " '1999,actor,1/19/99,Acting,William Baldwin',\n",
       " '1999,Singer-lyricist,1/20/99,Musician,Michael Stipe',\n",
       " '1999,model,1/21/99,Media,Carmen Electra',\n",
       " '1999,actor,1/25/99,Acting,Matthew Lillard']"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "raw_data.take(10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
